The demands created by today's high-speed electronic equipment have generated a number of problems for circuit designers and manufacturers. For example, many applications require that two subsystems running at different frequencies communicate with each other. Generally, logic running at a given clock frequency is said to be operating in a clock domain.
This synchronization problem has been previously addressed either by eliminating one of the clock domains or by adding synchronization logic. Unfortunately, the synchronization logic adds unwanted latency due to the additional circuitry. Moreover, the disparity between the clock domains may include different frequencies and/or phases, further complicating the synchronization circuit design and adding to the latency. Alternatively, eliminating one of the clock domains is not always feasible because there are practical limitations as to how many components a single clock source may support. Also a single clock domain will limit the independent optimization of each subsystem.
An example of a system with two clock domains is a memory subsystem that contains a memory clock domain and a controller clock domain. As stated above, the simplest solution to the clock domain problem is to ensure that a system only has one clock domain.
FIG. 1 shows a prior art system that contains only one clock domain. A clock source CLKSOURCE 102 uses a crystal 104 to generate a high-frequency clock, BUSCLK 106. In this example, BUSCLK 106 is shown traveling past a controller CTRL_A 108 to a termination resistor 110. The use of terminated transmission lines is common place in high-speed clock distribution, but is not required for this discussion.
In FIG. 1, BUSCLK 106 is buffered by buffers 112, inside controller 108. The use of buffers is common practice, but not required. Finally, the buffered version of BUSCLK 106 drives a clock divider C 114 which divides BUSCLK 106 to generate a clock called SYNCLK 116. The divider could have any value, including one (i.e., SYNCLK=BUSCLK).
A key aspect of FIG. 1 is that all of the logic in controller 108 runs off the same SYNCLK 116. SYNCLK 116 is buffered by buffers 117 and output from the controller 108 to drive the rest of the system as the system clock, SCLK_A 118. Since all of the control logic and the entire system run off a clock derived from SYNCLK 116, there are no clock domains to cross and no asynchronous data transfers required. However, it is very restrictive to require an entire system to run off one clock domain, and this approach is not practical for most systems. For example, running the system using one clock signal will result in each subsystem not being optimized to its fullest potential. Hence, each subsystem will, instead, be restricted by the limitations posed by a different subsystem.
FIG. 2 illustrates a more common approach. Elements appearing in FIG. 2, which were introduced in FIG. 1, are referred to with the same reference numerals which were originally used. In FIG. 2, CLKSOURCE 102 generates BUSCLK 106, which is divided to generate SYNCLK 116. However, in FIG. 2 a separate clock source MAIN CLK SRC 208 generates a second clock, SCLK_B 210, which is used by the rest of the system. SCLK_B 210 is buffered by buffers 211 to generate PCLK_B 212, inside CTRL_B 214. Alternately, SCLK_B 210 could be divided or multiplied to generate PCLK_B 212. After the clocks are generated, there are two clock domains, that of PCLK_B 212 and that of SYNCLK 116, between which data needs to be exchanged.
Because PCLK_B 212 and SYNCLK 116 are asynchronous, data cannot be exchanged directly from logic running in one clock domain to logic running in the other clock domain without losing data. Instead, data needs to be synchronized as it is passed between the two clock domains. For example, in FIG. 2, FIFOs 216 are shown which are driven by both PCLK_B 212 and SYNCLK 116 to synchronize data that is transferred between the domain of PCLK_B 212 and the domain of SYNCLK 116. While this synchronization is effective in solving some of the clock domain crossing problems, it adds additional latency to the data transfer.
For example, when two clock domains are asynchronous (no frequency or phase relationship), blocks of information are typically transferred with dual port memories. Data is written into a memory from one clock domain and read from the memory by the other clock domain. A second memory is needed for communication in the reverse direction. Control signals coordinate these empty-fill operations. The control signals are often double-sampled with registers in each clock domain to avoid metastability problems. This solution is robust, but typically has a significant latency cost because of the synchronization delay. Additionally, it can have a bandwidth cost if the empty-fill operations can not be overlapped because of synchronization overhead.
In view of the foregoing, it would be highly desirable to synchronize clocks from different clock domains, for example in a memory system, while minimizing any latency caused by the additional synchronization circuitry.